package com.micro.modual.extension;

import com.micro.common.MicroConstant;
import com.micro.common.biz.GeneratorCodeUtil;
import com.micro.common.util.SnowFlakeUtil;
import com.micro.modual.entity.GoodsSpu;
import com.micro.modual.model.bo.goodsspu.GoodsSpuBO;

/**
 * <h1>商品spu表 延展类</h1>
 * @author LevelCoder
 * @version V1.0.0
 * @email LevelCoder@126.com
 * @date 2020-08-04 00:23:27
 */
public class GoodsSpuExtension {

    /**
     * <h2>转换: 商品spu表 新增</h2>
     * @param goodsSpuBO {@link GoodsSpuBO} 商品spu表 新增/修改 请求对象
     * @return {@link GoodsSpu} 商品spu表
     */
    public static GoodsSpu converAddGoodsSpu(GoodsSpuBO goodsSpuBO) {
        GoodsSpu goodsSpu = new GoodsSpu();
        goodsSpu.setId(SnowFlakeUtil.getId());
                                                            goodsSpu.setSpuName(goodsSpuBO.getSpuName());
                                                    goodsSpu.setSpuCaption(goodsSpuBO.getSpuCaption());
                                                    goodsSpu.setBrandCode(goodsSpuBO.getBrandCode());
                                                    goodsSpu.setCategoryCode(goodsSpuBO.getCategoryCode());
                                                    goodsSpu.setTemplateCode(goodsSpuBO.getTemplateCode());
                                                    goodsSpu.setFreightCode(goodsSpuBO.getFreightCode());
                                                    goodsSpu.setMasterImage(goodsSpuBO.getMasterImage());
                                                    goodsSpu.setRotateImageList(goodsSpuBO.getRotateImageList());
                                                    goodsSpu.setGoodsDesc(goodsSpuBO.getGoodsDesc());
                                                    goodsSpu.setSpecItems(goodsSpuBO.getSpecItems());
                                                    goodsSpu.setParaItems(goodsSpuBO.getParaItems());
                                                    goodsSpu.setSalesVolume(goodsSpuBO.getSalesVolume());
                                                    goodsSpu.setCommentVolume(goodsSpuBO.getCommentVolume());
                                                    goodsSpu.setIsMarketable(goodsSpuBO.getIsMarketable());
                                                    goodsSpu.setGoodsItemCode(goodsSpuBO.getGoodsItemCode());
                                                    goodsSpu.setIsEnableSpec(goodsSpuBO.getIsEnableSpec());
                                                    goodsSpu.setIsDelete(goodsSpuBO.getIsDelete());
                                                    goodsSpu.setUserProvidedDegrees(goodsSpuBO.getUserProvidedDegrees());
                                                    goodsSpu.setSpuCode(goodsSpuBO.getSpuCode());
                                                    goodsSpu.setGoodsWeight(goodsSpuBO.getGoodsWeight());
                                                    goodsSpu.setGoodsPrice(goodsSpuBO.getGoodsPrice());
                                                    goodsSpu.setGoodsUnit(goodsSpuBO.getGoodsUnit());
                                                    goodsSpu.setSpuInfoType(goodsSpuBO.getSpuInfoType());
                            return goodsSpu;
    }

    /**
     * <h2>转换: 商品spu表 修改</h2>
     * @param goodsSpuBO {@link GoodsSpuBO} 商品spu表 新增/修改 请求对象
     * @return {@link GoodsSpu} 商品spu表
     */
    public static GoodsSpu converEditGoodsSpu(GoodsSpuBO goodsSpuBO) {
        GoodsSpu goodsSpu = new GoodsSpu();
        goodsSpu.setId(goodsSpuBO.getId());
                                                        goodsSpu.setSpuName(goodsSpuBO.getSpuName());
                                                goodsSpu.setSpuCaption(goodsSpuBO.getSpuCaption());
                                                goodsSpu.setBrandCode(goodsSpuBO.getBrandCode());
                                                goodsSpu.setCategoryCode(goodsSpuBO.getCategoryCode());
                                                goodsSpu.setTemplateCode(goodsSpuBO.getTemplateCode());
                                                goodsSpu.setFreightCode(goodsSpuBO.getFreightCode());
                                                goodsSpu.setMasterImage(goodsSpuBO.getMasterImage());
                                                goodsSpu.setRotateImageList(goodsSpuBO.getRotateImageList());
                                                goodsSpu.setGoodsDesc(goodsSpuBO.getGoodsDesc());
                                                goodsSpu.setSpecItems(goodsSpuBO.getSpecItems());
                                                goodsSpu.setParaItems(goodsSpuBO.getParaItems());
                                                goodsSpu.setSalesVolume(goodsSpuBO.getSalesVolume());
                                                goodsSpu.setCommentVolume(goodsSpuBO.getCommentVolume());
                                                goodsSpu.setIsMarketable(goodsSpuBO.getIsMarketable());
                                                goodsSpu.setGoodsItemCode(goodsSpuBO.getGoodsItemCode());
                                                goodsSpu.setIsEnableSpec(goodsSpuBO.getIsEnableSpec());
                                                goodsSpu.setIsDelete(goodsSpuBO.getIsDelete());
                                                goodsSpu.setUserProvidedDegrees(goodsSpuBO.getUserProvidedDegrees());
                                                goodsSpu.setSpuCode(goodsSpuBO.getSpuCode());
                                                goodsSpu.setGoodsWeight(goodsSpuBO.getGoodsWeight());
                                                goodsSpu.setGoodsPrice(goodsSpuBO.getGoodsPrice());
                                                goodsSpu.setGoodsUnit(goodsSpuBO.getGoodsUnit());
                                                goodsSpu.setSpuInfoType(goodsSpuBO.getSpuInfoType());
                            return goodsSpu;
    }
}
